#ifndef __EI_MAI_SMART_ISPMD_H__
#define __EI_MAI_SMART_ISPMD_H__

#define EI_MADP_SMART_ISPMD_ROW (32)
#define EI_MADP_SMART_ISPMD_COL (32)
#define EI_MADP_SMART_ISPMD_ZONE_MAX_NUM (EI_MADP_SMART_ISPMD_ROW * EI_MADP_SMART_ISPMD_COL)

#define EI_MADP_SMART_ISPMD_RECT_MAX (8)

typedef struct eiMADP_SMART_ISPMD_RESULT_S {
	EI_S32 s32Rect[4];
} EI_MADP_SMART_ISPMD_RESULT_S;

typedef struct eiMADP_SMART_ISPMD_DET_RESULTS_S {
	EI_U8 u8MotionMap[EI_MADP_SMART_ISPMD_ZONE_MAX_NUM];
	EI_S32 s32ISPMDNum;
	EI_MADP_SMART_ISPMD_RESULT_S stISPMDResult[EI_MADP_SMART_ISPMD_RECT_MAX];
	EI_U32 u32FrameWidth;
	EI_U32 u32FrameHeight;
} EI_MADP_SMART_ISPMD_DET_RESULTS_S;

typedef struct eiMADP_SMART_ISPMD_VENC_DATA_S {
	EI_VOID *pVStreamData;

	EI_U8 *pu8Addr;
	EI_U32 au32Len;
} EI_MADP_SMART_ISPMD_VENC_DATA_S;

typedef struct eiMADP_SMART_ISPMD_CAP_SNAP_RESULT_S {
	EI_U32 s32Num;
	EI_MADP_SMART_ISPMD_RESULT_S *pstISPMDResults;

	EI_U32 u32FrameId;
	EI_MADP_SMART_ISPMD_VENC_DATA_S *pstBgVencData;
	EI_U64 u64Timestamp;
} EI_MADP_SMART_ISPMD_CAP_SNAP_RESULT_S;

typedef EI_S32 (*EI_MADP_SMART_ISPMD_DET_DATA_CB)(EI_HANDLE hISPMd,
	EI_MADP_SMART_ISPMD_DET_RESULTS_S *pstDetResults, EI_VOID *pPrivData);

typedef EI_S32 (*EI_MADP_SMART_ISPMD_CAP_DATA_CB)(EI_HANDLE hISPMd,
	EI_MADP_SMART_ISPMD_CAP_SNAP_RESULT_S *pstCapResult, EI_VOID *pPrivData);

/** the attribute of smart ISP motion det*/
typedef struct eiMADP_SMART_ISPMD_CFG_S {
	/* det cb */
	EI_MADP_SMART_ISPMD_DET_DATA_CB pfnDetDataCB;
	EI_VOID *pPrivateDetData;

	/* snap cb */
	EI_S32 EnCapDumpImage;
	EI_S32 EnCapDrawBox;
	EI_S32 s32CapMode; /* 0: CAP_ISPMD_FAST_MODE 1: CAP_ISPMD_TIMER_MODE */
	EI_S32 s32CapInterval; /* ms */
	EI_S32 s32CapJpegQuality;

	EI_S8 s8Sensitivity;  /* range: [-128, 127] */

	EI_MADP_SMART_ISPMD_CAP_DATA_CB pfnCapDataCB;
	EI_VOID *pPrivateCapData;
} EI_MADP_SMART_ISPMD_CFG_S;

typedef struct eiMADP_SMART_ISPMD_ATTR_S {
	/* init attr start*/
	EI_HANDLE Vproc;
	EI_HANDLE Vport;
	EI_HANDLE VencChn;

	EI_MADP_SMART_ISPMD_CFG_S stISPMdCfg;
} EI_MADP_SMART_ISPMD_ATTR_S;

#endif /* __EI_MAI_SMART_ISPMD_H__ */

